<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>div</div>
    <script>
        var div = document.querySelector('div')
        //(function demo(){
        //    console.log(100)
        //})()


        div.addEventListener('click', function () {
            console.log(this.innerText)
        })
    </script>
</body>

</html>